import request from '@/utils/request'

// // 查询工作申请列表
// export function listApply(query) {
//   return request({
//     url: '/workflow/apply/list',
//     method: 'get',
//     params: query
//   })
// }

// 查询工作申请列表  2021-01-19 增加完成情况字段
export function listApply(query) {
  return request({
    url: '/workflow/apply/submitApplyList',
    method: 'get',
    params: query
  })
}

// 查询工作申请详细
export function getApply(applyId) {
  return request({
    url: '/workflow/apply/' + applyId,
    method: 'get'
  })
}

// 新增工作申请
export function addApply(data) {
  return request({
    url: '/workflow/apply',
    method: 'post',
    data: data
  })
}

// 修改工作申请
export function updateApply(data) {
  return request({
    url: '/workflow/apply',
    method: 'put',
    data: data
  })
}

// 删除工作申请
export function delApply(applyId) {
  return request({
    url: '/workflow/apply/' + applyId,
    method: 'delete'
  })
}

// 导出工作申请
export function exportApply(query) {
  return request({
    url: '/workflow/apply/export',
    method: 'get',
    params: query
  })
}

// 查询日志列表
export function logList(query) {
  return request({
    url: '/workflow/log/list',
    method: 'get',
    params: query
  })
}

// 查询附件
export function FileAllList(itemId) {
  return request({
    url: '/work/process/user/allFiles/' + itemId,
    method: 'get',
  })
}

// 审核流程
export function flowList(data) {
  return request({
    url: '/workflow/log/approve',
    method: 'post',
    data: data
  })
}

// 打回后 提交审批
export function ReFlowData(data) {
  return request({
    url: '/workflow/apply/submit',
    method: 'post',
    data:data
  })
}

